﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ex4.ClassPerson
{
    class Person
    {
        public string Name { get; set; }
        public int? Age { get; set; }

        public Person(string name, int? age)
        {
            this.Name = name;
            this.Age = age;
        }

        public override string ToString()
        {
            if (this.Age == null)
            {
                return string.Format("Name: {0,-10}, Age: {1}", this.Name, "null");
            }
            else
            {
                return string.Format("Name: {0,-10}, Age: {1}", this.Name, this.Age);
            }
        }
    }

    class ClassPerson
    {
        static void Main(string[] args)
        {
            Person person = new Person("Pesho", 18);
            Console.WriteLine(person);

            Person personWithNoAge = new Person("Viktor", null);
            Console.WriteLine(personWithNoAge);
        }
    }
}
